package com.mostromas.ess.product.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.mostromas.ess.entities.ProductStyle;
import com.mostromas.ess.product.mapper.ProductStyleMapper;
import com.mostromas.ess.product.service.IProductStyleService;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class ProductStyleServiceImpl extends ServiceImpl<ProductStyleMapper, ProductStyle> implements IProductStyleService {
    @Override
    public List<ProductStyle> findStylesByProductId(String id) {
        QueryWrapper<ProductStyle> wrapper = new QueryWrapper<>();
        wrapper.eq("product_id",id);

        List<ProductStyle> styleList = baseMapper.selectList(wrapper);

        return styleList;
    }
}
